package com.epam.edu.task01.tourism.voucher;

import com.epam.edu.task01.tourism.road.RoadInformation;

import java.util.Date;

public class VoucherToExcursion implements Voucher {
	private String city;
	private Date date;
	private int excursionCost;
	private int id;
	private int lunchCost;
	private String placeName;
	private RoadInformation roadInformation;
    private int voucherCost;

	public VoucherToExcursion(int id, String city, String placeName, Date date,
			RoadInformation roadInformation, int excursionCost, int lunchCost) {
		super();
		this.id = id;
		this.city = city;
		this.placeName = placeName;
		this.date = date;
		this.roadInformation = roadInformation;
		this.excursionCost = excursionCost;
		this.lunchCost = lunchCost;
        this.voucherCost=makeVoucherCost();
	}

    public int getVoucherCost(){
        return voucherCost;
    }

    public void setVoucherCost(){
        this.voucherCost=makeVoucherCost();
    }
	public String getCity() {
		return city;
	}

	public Date getDate() {
		return date;
	}

	public int getExcursionCost() {
		return excursionCost;
	}

	public int getId() {
		return id;
	}

	public int getLunchCost() {
		return lunchCost;
	}

	public String getPlaceName() {
		return placeName;
	}

	public RoadInformation getRoadInformation() {
		return roadInformation;
	}

 	@Override
	public int makeVoucherCost() {
		return (this.excursionCost + this.lunchCost + this.roadInformation
				.getCost() * 2) * 130 / 100;
	}

	@Override
	public String getVoucherType() {
		return "VoucherToExcursion";
	}

	public void setCity(String city) {
		this.city = city;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public void setExcursionCost(int excursionCost) {
		this.excursionCost = excursionCost;
	}

	public void setId(int id) {
		this.id = id;
	}

	public void setLunchCost(int lunchCost) {
		this.lunchCost = lunchCost;
	}

	public void setPlaceName(String placeName) {
		this.placeName = placeName;
	}

	public void setRoadInformation(RoadInformation roadInformation) {
		this.roadInformation = roadInformation;
	}

	@Override
	public String toString() {
		return "VoucherToExcursion [id=" + id + ", city=" + city
				+ ", placeName=" + placeName + ", date=" + date
				+ ", roadInformation=" + roadInformation + ", excursionCost="
				+ excursionCost + ", lunchCost=" + lunchCost +", voucherCost="
                + voucherCost+ "]";
	}

}
